import { View, Text } from '@tarojs/components';
import TaskItem from '../../components/TaskItem/TaskItem.jsx';
import { useSelector } from 'react-redux';
import './index.scss'

export default function Tasklist() {
  const list = useSelector(state => state.task.list);
  return (
    <View className='taskList'>
      {list && list.length ? list.map((item) => {
          return (
            <TaskItem isShowStatus={true} item={item} key={item.id} />
          )
      }) : <Text className='task-nodata'>暂无数据...</Text> }
    </View>
  )
}
